using System.Web.Http;
using WebActivatorEx;
using AssetsSys.WebApi;
using Swashbuckle.Application;
using System.Reflection;
using System.IO;

[assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")]

namespace AssetsSys.WebApi
{
    public class SwaggerConfig
    {
        public static void Register()
        {
            var thisAssembly = typeof(SwaggerConfig).Assembly;

            GlobalConfiguration.Configuration
                .EnableSwagger(c =>
                    {
                        c.SingleApiVersion("v1", "AssetsSys.WebApi");
                        var xmlPath = Path.Combine(System.Web.HttpRuntime.AppDomainAppPath, $@"App_Data\{Assembly.GetExecutingAssembly().GetName().Name}.xml");
                        c.IncludeXmlComments(xmlPath);
                    })
                .EnableSwaggerUi(c =>
                    {

                    });
        }
    }
}
